import request from '@/utils/request'

export function allProject() {
    return request({
        url: '/admin-api/business/project/all',
        method: 'get'
    })
}

/**
 * 分页查询项目列表
 */
export function pageListProject(query) {
    return request({
        url: '/admin-api/business/project/page/list',
        method: 'get',
        params: query
    })
}

// 查询项目列表2
// export function listTProject2(query) {
//   return request({
//     url: '/admin-api/business/project/list2',
//     method: 'get',
//     params: query
//   })
// }

// 查询项目详细
export function getProject(projectId) {
    return request({
        url: '/admin-api/business/project/' + projectId,
        method: 'get'
    })
}

// 新增项目
export function addProject(data) {
    return request({
        url: '/admin-api/business/project',
        method: 'post',
        data: data
    })
}

// 修改项目
export function updateProject(data) {
    return request({
        url: '/admin-api/business/project',
        method: 'put',
        data: data
    })
}

// 删除项目
export function delProject(projectId) {
    return request({
        url: '/admin-api/business/project/' + projectId,
        method: 'delete'
    })
}

export function recordProject(projectId) {
    return request({
        url: '/admin-api/system/project/switch-project?projectId='+projectId,
        method: 'post',
    })
}
